import requests


class Api:
    def __init__(self):
        self.headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer GXopRllxc9s91e3UPL2eiEGYQjUf8VlJ'}
        self.url_delete = 'https://www.gaoliyun.com.cn/api/v5/app/entry/data/batch_delete'
        self.url_list = 'https://www.gaoliyun.com.cn/api/v5/app/entry/data/list'
        self.url_write = 'https://www.gaoliyun.com.cn/api/v5/app/entry/data/batch_create'
        self.timeout = (30, 300)

    def write(self, json):
        return requests.post(self.url_write, headers=self.headers, json=json,timeout=self.timeout)

    def delete(self, json):
        return requests.post(self.url_delete, headers=self.headers, json=json,timeout=self.timeout)

    def list(self, json):
        return requests.post(self.url_list, headers=self.headers, json=json,timeout=self.timeout)


if __name__ == '__main__':
    api = Api()
